import request from '@/utils/request'

/**
 * 查看一体杆列表
 *
 * @param { page, pageSize, poleName, poleNumber, poleStatus } params
 *
 * @returns { Promise }
 */
export function getRodListAPI(params) {
  return request({
    url: '/pole/info/list',
    method: 'get',
    params
  })
}

/**
 * 添加一体杆
 *
 * @param { poleName, poleNumber, poleIp, areaId, poleType } data
 *
 * @returns { Promise }
 */
export function addRodAPI(data) {
  return request({
    url: '/pole/info',
    method: 'post',
    data
  })
}

/**
 * 编辑一体杆
 *
 * @param { id, poleName, poleNumber, poleIp, areaId, poleType } data
 *
 * @returns { Promise }
 */
export function updateRodAPI(data) {
  return request({
    url: '/pole/info',
    method: 'put',
    data
  })
}

/**
 * 删除一体杆
 *
 * @param { String } ids id用逗号隔开
 *
 * @returns { Promise }
 */
export function deleteRodAPI(ids) {
  return request({
    url: `/pole/info/${ids}`,
    method: 'delete'
  })
}
